Repository navigation
feat(studio,api): RFC-0045 step 6b, builder, delete dialog and publish warnings - #220
Merged
Merged
Conversation
…h warnings - /api/instance reports features.referenceFields (the store's capability, MCP's rule); the fields builder offers reference and list only then, so production Studio is unchanged until step 7. - Builder: a reference's target collections, "Several", maximum and conditions (the page editor's condition rows, no `now`); a list's item fields as rows with up/down and a menu (stable ids, focus kept), a nested dialog per item field, the maximum and the item name. - Operations: "Applies to" a list's item field for rename, change type and remove; reference and list targets with their settings; a run or revert stuck on values that stopped converting finishes with onInvalid "clear" behind a ticked confirmation. - Delete: DELETE ...?dryRun=1 runs the store's plan; the dialog keeps Delete off while it refuses (entry_referenced), says archiving doesn't help, lists drafts that will show nothing, and names the language that loses the card. DeleteResource gains deleteDisabled. - Publish: GET .../entries/reference-issues (referenceIssues over the working copy) and lazy warnings in the site's publish dialog. - Worded API errors for the RFC-0045 refusals; AI drafts for 18 languages. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
- Delete dialog: group members under their own cache key (the editor's `entry-groups` has another shape); the blocked list shows each holder's real status and the published versions that show its value; "other entries left" counts only members in an allowed collection; a refusal of the real delete shows in the dialog (referrers, or its words). - Change type: checks the contract's and RFC-0045's rules only (a select with labels in another language can be retyped) and shows problems inline. - A reference's conditions follow its target; leftovers are flagged. - Unsaved item fields keep key and type editable; the item name follows a renamed field (options keyed by stable row ids). - "Add condition" and "Add item field" stay focusable at their limits. - A stuck operation locks its inputs and is announced (role="alert"). - "And # more references." where references are counted. - i18n: three new keys, two reworded; AI drafts for 18 languages. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
- A delete refusal belongs to one opening of the dialog for one revision: reopening or a new revision asks the store again. - A reference's conditions are dropped only for a new single target. - A type change's target settings lock (disabled fieldset) with its inputs. - "Other entries left" is decided per referring field; both notices can show. - The blocked count is the store's total; the "more references" note shows whenever rows remain; a late refusal reads the referrers again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC-0045 rollout step 6, second PR: the fields builder, the delete dialog and the publish warnings. Step 6a (#219) covered the blocks and the entry editor.
Production is unchanged. Both types stay refused on every production write path until step 7, and the builder offers them only where the server reports the capability.
The capability gate
/api/instancegainsfeatures.referenceFields. It is true when the store hasSiteGraphStoreOptions.fieldTypes, the same rule MCP's tool lists use (step 5).Studio offers Reference and List in the type
Select, and as "Change type…" targets, only when it is on (useReferenceTypes). A saved field of either type still shows its type.Tests mock the flag.
design:shotsran against a local Studio whose site was seeded through a store withfieldTypes(saved definitions show without the flag).Builder (
FieldDialog)ReferenceFieldsForm.tsx):Checkbox.Groupof the site's collections, one to five.ConditionRow, now exported withnoNowsince dates can't benowhere. It works over the single target collection's listing fields; a muted line explains when there are several targets or no listing fields.SubFieldList.tsx):LayerDialogwith the same form in sub-field mode: sub-field types, no languages switch, search or "Several"; a reference sub-field takes collections only.Operations (
FieldOperationDialog,OperationInputs.tsx)sub.collections,multiple,maxItems,subFields,itemLabel) drawn with the builder's own parts.unconvertibleis non-empty. Before, the dialog looped up to 200 times; now it stops. The dialog shows a "Clear and finish" step: an alert, a confirmation checkbox, and a destructive primary button that sendsonInvalid: "clear"on the continue or the revert.Delete dialog (
EntryDeleteDialog, used by the editor and the articles list)DELETE …/entries/:id?rev=&dryRun=1runs the store's own delete plan (deleteContentEntry(entry, { dryRun })) and writes nothing. It answers{ dryRun: true }or the plan's refusal.entry_referenced, Delete stays off:DeleteResourcegains adeleteDisabledprop. An error banner says "Unpublish or edit these n published entries first" and that archiving doesn't help, andUsedByListlists the referrers from the refusal's details.default-with-notice, it says they'll show the default language's version instead.entry_referencedandtranslation_group_in_userefusals of a group change now have words inerrors.api, along with the other RFC-0045 codes.Publish warnings
GET …/entries/reference-issues(content:read, on the playground allow-list) runsreferenceIssuesover the working copy. It returns the first 50, each with the holder's title, and the total. A site without reference fields answers without reading its entries.PublishWarnings: an alert ("n references will show nothing", and that publishing goes ahead) and up to five holders, each linked, with the language, the field and the reason.Deviations (also in the RFC, "Amended in 6b")
/api/instance), not per site, as in MCP. The store still refuses per site (fields_unsupported, now worded).reference-issues.docs/guides/fields.mdis left to step 7, as the brief allowed.Bundle
The initial load goes from 391.9 to 392.9 kB gzip (budget 420): about +0.3 kB for the ten new
errors.apisentences, and about +0.6 kB for the lazy publish-warnings wrapper and one chunk the split adds. Everything else loads with the lazy fields chunks.i18n
New words in the lazy
fieldsnamespace (56 keys) anderrors.api(10).enis hand-written; the other 18 languages are AI drafts awaiting review, imported withpnpm i18n:import. No language is marked reviewed. Two keys were named…limitbecause the i18n test reads…Manyas a hand-made plural.Checks
design:lintandsize:checkpass. Three functions were split to stay under 150 lines, andcreateApikeeps its line count.design:shotsat 1440 and 390 px passes, with no sideways scroll and no console errors, on three screens: the builder with a list's item fields, the delete dialog blocked by published referrers, and the publish dialog with a warning.apps/studio/test/fields-builder-references.test.tsx(10): the gate on and off; editing a reference's collections and conditions and saving; refusing a reference without collections; adding an item field in the nested dialog, the moved row keeping focus, and saving the order; the operation requests withsuband the new inputs; a stuck run finishing withonInvalid: "clear"only after the confirmation; the delete dialog blocked, drafts, and the language note; publish warnings.reference-issues, and the instance flag.design-rules.test.tsnow checks that articles delete throughEntryDeleteDialogand that it composesDeleteResourcewithMenuDeleteNotice.pnpm checkwith its default concurrency overloads this machine (see feat(studio,ui,api): RFC-0045 step 6a, reference and repeater fields in the entry editor #219), so the suites ran one package at a time.🤖 Generated with Claude Code